define(["dojo/_base/json"], function (json) {
    
	var index = 0;
	
	return: {
		loadData: function(taskid, data, callback){
			//Get data from BPM
			debugger;
			for (var i = 0; i < data.length; i++) {
				var params = "";
				params += "mode=get";
				params += "&taskid=" + taskid;
				params += "&path=" + data[i].path;
				
				osapi.http.get({
					'href' : "http://wpsvm110.boeblingen.de.ibm.com:9081/servlet/ProxyServlet?" + params,
					'format' : 'text',
					'headers' : {
						'Cookie' : [
							document.cookie
						]
					}
				}).execute(callback);
			}
			return data;
        },
		insertData: function(_response) {
			//Parse json
			debugger;
			alert(_response.content);
			var data = dojo.fromJson(_response.content);
			context.path[index].val = data.result;
			index++;
		}
	};
});